08. All Promises

All Promises

2.8 All Promises Quiz

Instructions

First, if you haven't already, read this and follow the instructions on working with the Exoplanet Explorer repo.

  1. Checkout the all-start branch and navigate to app/scripts/app.js.
  2. Use Promise.all() to refactor the .map code by passing Promise.all() an array of Promises.
    • Each Promise will be executed in parallel.
    • The return values will be returned in the same order as the Promises were created.

Hint: you'll probably still need to use .map.

Documentation for Promise.all

Checkout the all-solution branch to see my code!

Cam says: did you notice the data was requested in a different order in the video? If you did, good eye. I changed the order of the array of URLs between filming this class and releasing it. The reason is that the first URL didn't have enough data to show the Earth and planet scale visualizer and I wanted it to show up.